package com.htgd.gardenexpo.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;

@Configuration
public class FilterConfig {

    @Bean
    public FilterRegistrationBean<DecryptingFilter> decryptingFilter() {
        FilterRegistrationBean<DecryptingFilter> registrationBean = new FilterRegistrationBean<>();
        registrationBean.setFilter(new DecryptingFilter());
        registrationBean.addUrlPatterns("/*"); // 设置过滤器作用的 URL 模式
        registrationBean.setOrder(1); // 设置过滤器的优先级，数值越小优先级越高
        return registrationBean;
    }
}
